package com.nanohadoop.yarn;

import java.io.Serializable;

/**
 * 表示系统中的资源
 */
public class Resource implements Serializable {
    private static final long serialVersionUID = 1L;

    private int memoryMB;  // 内存（MB）
    private int cpuCores;  // CPU核心数

    public Resource(int memoryMB, int cpuCores) {
        this.memoryMB = memoryMB;
        this.cpuCores = cpuCores;
    }

    // Getters and Setters
    public int getMemoryMB() { return memoryMB; }
    public void setMemoryMB(int memoryMB) { this.memoryMB = memoryMB; }
    public int getCpuCores() { return cpuCores; }
    public void setCpuCores(int cpuCores) { this.cpuCores = cpuCores; }

    @Override
    public String toString() {
        return "Resource{" +
                "memoryMB=" + memoryMB +
                ", cpuCores=" + cpuCores +
                '}';
    }
}